package gds.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class versuchContent implements ActionListener{

	private versuchxXx controlledPanel;
	private versuchImagePanel imagePanel;
	
	public versuchContent(){
		this.controlledPanel = null;
		this.imagePanel = null;
	}
	
public versuchContent(versuchxXx c){
		
		controlledPanel = c;
		
	}
	
	public versuchContent( versuchImagePanel a){
	
		//controlledPanel = c;
		imagePanel = a;
}

	@Override
	public void actionPerformed(ActionEvent event) {
		controlledPanel.getsave_Field().setText("");
		
		if(event.getActionCommand().equals("load")){
			load();
		}
		if(event.getActionCommand().equals("neues Bild laden")){
			newLoad();
		}
		if(event.getActionCommand().equals("algo1")){
			algo1();
		}
		if(event.getActionCommand().equals("algo2")){
			algo2();
		}
		if(event.getActionCommand().equals("algo3")){
			algo3();
		}
		if(event.getActionCommand().equals("algo4")){
			algo4();
		}
		if(event.getActionCommand().equals("algo5")){
			algo5();
		}
		if(event.getActionCommand().equals("algo6")){
			algo6();
		}
		if(event.getActionCommand().equals("algo7")){
			algo7();
		}
		if(event.getActionCommand().equals("algo8")){
			algo8();
		}
		if(event.getActionCommand().equals("jpg")){
			datenTypWahl();
		}
		if(event.getActionCommand().equals("png")){
			datenTypWahl();
		}
		if(event.getActionCommand().equals("gif")){
			datenTypWahl();
		}
		if(event.getActionCommand().equals("psd")){
			datenTypWahl();
		}
		if(event.getActionCommand().equals("save")){
			save();
		}
	}

	public void load(){
		controlledPanel.getsave_Field().setText("test");
	}
	public void newLoad(){
		controlledPanel.getsave_Field().setText("test2");
	}
	
	public void algo1(){
		controlledPanel.getsave_Field().setText("test3");
	}
	
	public void algo2(){
		controlledPanel.getsave_Field().setText("test4");
	}
	
	public void algo3(){
		controlledPanel.getsave_Field().setText("test5");
	}
	
	public void algo4(){
		controlledPanel.getsave_Field().setText("test6");
	}
	
	public void algo5(){
		controlledPanel.getsave_Field().setText("test7");
	}
	
	public void algo6(){
		controlledPanel.getsave_Field().setText("test8");
	}
	
	public void algo7(){
		controlledPanel.getsave_Field().setText("test9");
	}
	
	public void algo8(){
		controlledPanel.getsave_Field().setText("test10");
	}
	
	public void save(){
		controlledPanel.getsave_Field().setText("test11");
	}
	
	public void datenTypWahl(){
		if (controlledPanel.getbox_jpg().isSelected()){
			controlledPanel.getbox_png().setSelected(false);
			controlledPanel.getbox_gif().setSelected(false);
			controlledPanel.getbox_psd().setSelected(false);
			controlledPanel.getsave_Field().setText("1");
		}else
		if (controlledPanel.getbox_png().isSelected()){
			controlledPanel.getbox_jpg().setSelected(false);
			controlledPanel.getbox_gif().setSelected(false);
			controlledPanel.getbox_psd().setSelected(false);
			controlledPanel.getsave_Field().setText("2");
		}else
		if (controlledPanel.getbox_gif().isSelected()){
			controlledPanel.getbox_png().setSelected(false);
			controlledPanel.getbox_jpg().setSelected(false);
			controlledPanel.getbox_psd().setSelected(false);
			controlledPanel.getsave_Field().setText("3");
		}else
		if (controlledPanel.getbox_psd().isSelected()){
			controlledPanel.getbox_png().setSelected(false);
			controlledPanel.getbox_gif().setSelected(false);
			controlledPanel.getbox_jpg().setSelected(false);
			controlledPanel.getsave_Field().setText("4");
		}
	}
}
